#ifdef _MSC_VER
# pragma once
#endif
#ifndef FASTCLIENTMESSAGEINTERPRETER_H
#define FASTCLIENTMESSAGEINTERPRETER_H
#include <Codecs/MessageConsumer.h>
#include <Messages/MessageFormatter.h>

    /// @brief A message consumer that attempts to produce a human readable version
    /// of a message that has been decoded by QuickFAST.
    class FASTClientMessageInterpreter : public QuickFAST::Codecs::MessageConsumer
    {
    public:
      /// @brief Construct given a ostream to which to write the interpreted results.
      FASTClientMessageInterpreter(std::ostream & out, bool silent = false);
      virtual ~FASTClientMessageInterpreter();

      /// @brief set the level of log messages that we are interested in.
      /// @param level is the first level that will *NOT* be displayed.
      void setLogLevel(QuickFAST::Common::Logger::LogLevel level);

      ////////////////////////////
      // Implement MessageConsumer
      virtual bool consumeMessage(QuickFAST::Messages::Message & message);
      virtual bool wantLog(unsigned short level);
      virtual bool logMessage(unsigned short level, const std::string & logMessage);
      virtual bool reportDecodingError(const std::string & errorMessage);
      virtual bool reportCommunicationError(const std::string & errorMessage);
      virtual void decodingStarted();
      virtual void decodingStopped();

    private:
      QuickFAST::Messages::MessageFormatter formatter_;
      std::ostream & out_;
      size_t indent_;
      size_t recordCount_;
      QuickFAST::Common::Logger::LogLevel logLevel_;
      bool silent_;
    };

#endif /* FASTCLIENTMESSAGEINTERPRETER_H */
